#include "welcomepage.h"
#include"SafeQueue/safequeue.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include "QFile"
#include "Beans/userinfobeab.h"
#include "thread/threadwork.h"
#include "softregist.h"
#include "test/form.h"
#include "QSettings"
#include "measurepage_p1.h"
#include "qdebug.h"

SafeQueue<QByteArray> gParseQueue;
void setStyle();
void setStyle2();
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    qRegisterMetaType<UserInfoBeab>("UserInfoBeab");
    qRegisterMetaType<ThreadWork>("ThreadWork");
    QTranslator translator;
    const QStringList uiLanguages = QLocale::system().uiLanguages();
    for (const QString &locale : uiLanguages) {
        const QString baseName = "XYMentalPressureAna_" + QLocale(locale).name();
        if (translator.load(":/i18n/" + baseName)) {
            a.installTranslator(&translator);
            break;
        }
    }



#if 1
    //常规版本
    setStyle();
    WelcomePage w;
    // Form w;
    w.show();
#endif


#if 0
    //济宁普瑞森体检系统对接版本
    setStyle2();
    MeasurePage_P1 w;
    w.show();
#endif

    return a.exec();
}
void setStyle()
{
    QFile file(":/qss/style_xy.css");
    QString styleSheet;
    file.open(QFile::ReadOnly);
    styleSheet = QLatin1String(file.readAll());
    qApp->setStyleSheet(styleSheet);
    file.close();
}
void setStyle2()
{
    QFile file(":/qss/style_prs.css");
    QString styleSheet;
    file.open(QFile::ReadOnly);
    styleSheet = QLatin1String(file.readAll());
    qApp->setStyleSheet(styleSheet);
    file.close();
}
